<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
    <div id="app">
        <button @click="handleClick()">正在热映</button>

        <ul v-for="film in filmsList">
            <li>
                <h3>{{ film.name }}</h3>
                <img :src="film.poster">
            </li>
        </ul>
    </div>

    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                filmsList: 
                [
                    {
                        name: '',
                        poster: '',
                    }
                ]
            },
            methods: {
                handleClick(){
                    axios.get("./json/test.json").then(res => this.filmsList = res.data.data.films )
                }
            }
        })
    </script>
</body>
</html>